
<div style="float:none;clear:both;">
	


<h2>Sending Message To: <%= @smart_group.name %></h2>

<% form_tag({:action => 'worker_send_smart_group_contact', :smart_group_id => @smart_group}, :id => 'this_form') do %>

<div style="float:left;width:48%;">
	<fieldset><legend><strong>Select Group Members</strong></legend>
		<input type='submit' value='Check All' onClick="$$('#this_form input.check').each(function(box){box.checked=true});return false;" />
		<input type='submit' value='Uncheck All' onClick="$$('#this_form input.check').each(function(box){box.checked=false});return false;" />
		<% @smart_group.found_people.sort_by(&:last_first_name).each do |p| %>
			<div id="person_id_<%= p.id %>">
				<span id="checkbox_id_<%= p.id %>">
				<%= check_box_tag 'included_people[]', p.id, ! p.no_best_email?, {:class => 'check', :disabled => p.no_best_email?} %></span>
				<%= p.full_name %>
				<span id="message-black">
					<%= p.best_email.email rescue nil %>
				</span>
			</div>
		<% end %>
	</fieldset>
</div>

<div style="float:right;width:48%;">
	<fieldset><legend><strong>Create Message</strong></legend>
		<label>Subject:</label><br>
		<%= text_field 'email', 'subject' %><br>
		<label>Message:</label><br>
		<%= text_area 'email', 'message', :rows => 20, :cols => 30 %>
	
		<span style="float:left;">
				<%= submit_tag 'Send Mail' %>
		</span>
	</fieldset>	
</div>

<% end %>
&nbsp;
<div id="empty" style="float:none;clear:both;"></div>
</div>

